package com.example.project_01.mapper;

import com.example.project_01.dto.MedicalPolicyQueryDTO;
import com.example.project_01.model.MedicalPolicyModel;
import com.example.project_01.pojo.MedicalPolicy;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper  // 标记为MyBatis接口，Spring Boot自动扫描
public interface MedicalPolicyMapper {

    List<MedicalPolicyModel> selectByCondition(MedicalPolicyQueryDTO queryDTO);

    List<MedicalPolicyModel> selectByPage(
            @Param("query") MedicalPolicyQueryDTO queryDTO,
            @Param("offset") Integer offset,
            @Param("pageSize") Integer pageSize
    );

    Integer selectTotalCount(MedicalPolicyQueryDTO queryDTO);

    //添加订单数据
    int add(MedicalPolicy medicalPolicy);

    //根据id删除某一条数据 憎删改
    int deleteById(Long id);

    //查找所有医保政策数据信息
    List<MedicalPolicy> findAllMedicalPolicy();

    //根据id修改数据
    int updateMedicalPolicyById(MedicalPolicy medicalPolicy);
}
